/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateSistemaPedidosData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = com.belencarrasco.orm.SistemaPedidosPersistentManager.instance().getSession().beginTransaction();
		try {
			com.belencarrasco.orm.DAOFactory lDAOFactory = com.belencarrasco.orm.DAOFactory.getDAOFactory();
			com.belencarrasco.orm.dao.PedidoDAO lcombelencarrascoormPedidoDAO = lDAOFactory.getPedidoDAO();
			com.belencarrasco.orm.Pedido lcombelencarrascoormPedido = lcombelencarrascoormPedidoDAO.createPedido();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : estado, descripcion, mesa
			lcombelencarrascoormPedidoDAO.save(lcombelencarrascoormPedido);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateSistemaPedidosData createSistemaPedidosData = new CreateSistemaPedidosData();
			try {
				createSistemaPedidosData.createTestData();
			}
			finally {
				com.belencarrasco.orm.SistemaPedidosPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
